package com.example.app.viewmodel

import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableFloatStateOf
import androidx.compose.runtime.mutableIntStateOf
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.setValue
import androidx.lifecycle.ViewModel

class TaskViewModel : ViewModel() {
    var taskData by mutableStateOf("学习周期：2024-11-1-2024-11-12")
        private set

    var totalPointYear = 13500

    //学年积分
    var pointOfYear by mutableIntStateOf(10000)
        private set

    //学年积分进度 220f*pointOfYear/学年总积分
    var pointOfYearPercent by mutableFloatStateOf(0f)
        private set

    /**
     * 更新学年积分进度
     */
    fun updatePointPercent() {
        pointOfYearPercent = 220f * pointOfYear / totalPointYear
    }

    var pointsOfWeek by mutableStateOf(listOf(0.0, 2.0, 6.0, 9.5, 10.0, 15.0, 5.0))
        private set

    val weeks= listOf("11.07","11.08","11.09","11.10","11.11","11.12","11.13")
}